added checks for matching return type and the appropriate tests