scaling logic