Changed order of functions

Order of implementation follows order of declaration