Modified toolbox.js. Gave more descriptive names to functions. Added a lot of comments.