fixed a bug. learned about cuda-memcheck, too, which is good