changed the capital letter rule to be more robust