Added an addFunction method for #1mp