Cleaned up matches(). Updated version.