some sequence utility functions