implement some functions in modDraw