fixed some drawing code