Hw1

real final homeworw, fix some bugs