Fixed some formatting and added some comments