algorithm improved
scaling