Encapsulated total error and made depth assignment implicit.