Prepared code for adding collision detection