changed from jQuery prototype to an angularjs app