graphical scaling algorithm debugging, working