Almost done with hw6.m