Finished adding new functions to cuda util, and rewriting fit_cuda code