Added some smarts around scaling