added isValidChar function
added print and newline functions
final version