Add lots of comments and fix stuff