Merged develop and feature/nearest_neighbor, but test fails.
Modified to pass test.