Changes to angular JS code