finish all the function in hw4.cpp, and succeed to stitch!