cleaned up some spots, added some comments