updated: changed everything from double to float. Completed device memory allocation (untested).