drawing code revamp