rearranged setup/draw code to make the mouse dragging work