Add type specs for functions