Refactored and added source to solution for finding paths