change wrapping, add alias and variable replacement, pass tests