my solution to the assigment