debug option in getClosest
improved CLI in getClosest