cleaned up the code, added some flags, added readme