updated the collision detection to work with time offsets