Implemented leveling, except for some output values.