cleaned up code some
added some documentation notes