Setting up global memory