May want to make this into a function on the ```$scope```.