passed all published test cases on website

appears to be working as expected.
first submitted code.