Clean up and speed up simult_.m