Updated to use AngularJS