Update app.js

Got 3 of 8 steps to work using logic instead of static numbers on n=8.