modularized the array and the name
replaced $scope with "as smpctrl" and vm = this