implement sequence comparison