cleaned up readCharFromFile