Added underscore and restructured ng-repeat

nested ng-repeat to avoid repetition