Added some angular.js logic