Improved documentation
Added a check_chars() methods to make code more readable