fixing wave function. Test: "scale wave box"