Improved the chasing algorithm