added scaleInOut function