Fixed indexing on Arduino code