Changes made according to hw6 instructions.