Final code - passed all tests

needs explanation code