added else statment to function 3 in sting lib passing to main code