format the input into the expected form