some bug fixed and fit the spec
project2 main function done,add comment later