changing kernel to use local memory rather than global