update lval to allow storing functions
add constructor for user defined lval functions