adding scaling and other minor features