added sanity check to sum along columns
envAlgRes compiles, produces matrix, sanity chech fails