fixing jslint warnings
using JSLint style (except variables starting with _)