Added type declarations to function headers for ease of reading