fleshed out constructor for user defined functions