Removed some debug outputs.
Removed unused acceleration variable. Also: refactoring.