new and improved

cleaned up the code and do all the work in angularJS