updated main.js with MainCtrl and moved win functions up in playBox