added drawing code