Improved eraser/pencil functions
Documented code with JSDoc 3.3