trying to fix basic freehand drawing functionality with the consultation of a tutorial