Final code; correct results with example_entries, all tests passing