Implemented algorithm in CUDA for 145x speedup