Minor array indexing bugfix (task 4)