Changed function names to be more uniform, added in more comments, added small bits of functionality.