added simulation running code (fails now)