solution which passes all tests