Added option for collision detection