wrote get first nonrepeating character method