begin draw function