made more general, moved some code into conservation law classes