cleaned up some formatting and added some comments.