respected jslint and simplified random code