added some comments
improved formatting a little