fixed collision bug
added pause and restart functionality
code cleaning