changed drawing code