More snippets, cleanup

added console.log("Value: ", val)
for(var i=0; i<n; i++)