Simulation now wrapped in its own function with a test driver (master) for everything, looks cleaner