added method for returning number of collapsable nodes