separated judgeables function from anonymous function in angular controllers.js