cleaned up the code by removing dead functions, ugly spacing and overly-retarded comments. also moved code into seperate files.