adding megans simulation code