Added more documentation to lab3.js

Wanted to add more comments to the code for others that might look.