added readme and cleaned up some code