Finished, just needs testing when cuda is done