add test for scale
cleanup code