fixed bug, hw6-1