removed console.logs
change count sorting