find closest and output