Added a good amount of comments, cleaned code.