Prep function now working no matter what order the data is passed in