Personal studies around nearest neighbor algorithm