started on collision detection algorithm