Week 5

Finally got the program working. More comments below.