you spend quite some work on this, but its quite easy to also implement drawing squares (drawrect) and elipses (drawrect -e)