draw function works