oops, functype function was broken! fixes issue #19