refactored countGemStones with a helper function
remove comments
refactored gem stones using $! acc function so we do not blow the stack