changed indexing on the output