change algorithm to run on GPU