rewriting project in cuda