add type declarations to functions