increaed data limit length, rewriten some code to match the jb javascript coding guidelines