Change to index logic and provide loop for including all values