using draw function