create nearestNeighbors for any n, refactor codebase to be more modular, and introduce mock user and product functions for testing.