added cycling through list in angular function