Changed the indexing to the array way of doing it