optimization, pw change function (still buggy --> api?)