added whole given code

... now need to figure out what to do next