cleaned up code, added input generator, added simulator test