fixing functions to conform to new grammar structure