Looks about right to me, just make sure the states and parameters are returned in the order you expect.