Cleaning up the GPU version - in progress