adding support for new functions. Incompleate. do not use.