Final Working Drafting of main.js
using array setup