removed literate implied function calls, changed var to let for consistency with ES6