Working. Reduction kernel has to be modified to work wtih matrix sizes > 512