Partially working version using AngularJS