Use the default destructor
Split apart the energy function
Skeleton code for BP on CUDA