finish drawing code