Making sure function returns characters