Pushed utils out into utils.js
Added comments