updated readme and cleaned up code