Computing column count in a more general manner.