draw line function has been finished