enhancements to calculating frequencies