Changed variable names, added comments and refactored a function in process.js