orrected thirdchar function to match the problem asked, corrected the sig too.