refactored code into multiple files. neighbors algorithm still not behaving as expected.