remake function resize