Generalised K-nearest nodes by Burak Kanber