'simulate' no longer turns off gravity.
Removed sleep from simulate for cross-platformness.
Cleaned up optimization code.