Added automatic scaling