Final version of week2 homework