Array wasn't properly indexing