Updated index.js - fixed file reading function.