my solution to 2
add char count method