fix some bug in lab2, pass two test cases