switched result count to index.js