do some clean up
clean up some more and fix some bugs