Switched locations

switched the locations of the functions