SrBuj after JSHint and jsbeautifier tools
some minor changes in declaration and sanitization of variables