minor changes to drawing code