added scaling functionality