Functions to create functions and evaluate expressions