preliminary drawing code