Made count more functional and recursive, weee!