first phase of code validation
added prototype and make this work again...
second phase of lint
pass jsl and gjslint