changed the name of the CountSpaces function for consistency.