added count_holes pseudocode