Added a few comments explaining functions in draw.js.