Finish parser
Add substitute function