updated app.js with new keypress func