Nice Start. I suggest you to add blocks for the creation of circles at the edges (keeping their radius half of the line width) otherwise the curves will have sharp cuts as noticed by @ADDYLIN . Also add colour changing and eraser option and this guide will become complete and more useful.
If you want you can refer to AIA provided here
and explain its logic too.