added function to parse function definitions