Fixed BUG: distance not correctly checked in target acquisition algorithm