jshint fixes
fully functional
now to prove it with some proper tests