I thought the assignment might have been a little cruel for some people, so I have attached two possible solutions. make sure you understand how they work!