Included more code comments, some minor changes