Added substring counting (may be slow for now)