Cleaned up character count routines and comments, added a throw prototype