Add typing for functions