extracted drawing code into a function