Updated index view agian with better loop