added (untested) support for enums and (tested) support for functions