added scaling, L2norm and tests