types in functions working