Finish the q1 code, but still has some problem about path and format.