Added Type checking on return statements to check they return the same
type as the function type that they are present in