Improved function plugin.