added preliminary code for collisions