Updated with angular and edited some javascript