extended data analysis, added searching for closest points