Rewrote some of the cudaf specific parts. Compiles but returns an error on copying out count_d int count_h