Added simple countRange function