Grammar: added functions as params and return values; updated tex