code according to google javascript style guide