initial commit of simulation code written by Ash