Improvements to drawing code
merge