added tons of comments, formatted a few things, and got rid of a few function that weren't being used