add scale and rotate function