changed arrays to be javascript objects instead to take advantage of angular directives