created an enum instead of just numbers for CharType & fromtype