working on week2 code, rough solutions to task 1 and 2, task 3 needs some more work