Initial implementation of simulation, but it doesn't quite work