added more tests and refactoring
added tests for collision