finds minimum trap distance now