Added type annotations for function definitions.