changed nestcking to handle odd refinement