updated for runtime exception of invalid pattern
updated with separating dataset