changes for scaling, but not working correctly