Fixed some formatting, added more comments