Finish unfinished code
Correct some mistakes