added scaling support