Fixed issue with indexing offset. Now code reproduces same results as before shared memory