cleaned up whitespace
added some comments