Tweaked order of calls in ast to inline to reduce needless lookups
Altered the map function in inline_formulae to include less redundant looping