writing code for collision. Still on the draft