Implemented leveling, including output values.