Removed useless comments at the top
Removed two empty and useless functions, they don't seem to have a purpose
Moved all code that resides outside functions to the bottom
Indented the whole script by one level so that it's easier to see where <php starts and ends