tried to decrease global memory access