Stopped working with discrete-time algorithm of collision detection