fixing up drawing code a bit