Added auto scale functionality