close to re-implementation of pattern tweening