WIP: add a simulator program
simulator reads input in
fix many bugs