Finish recursive count function