Adds collision detection and resolution