created a fully generic sequence factory function
changed factory functions to createpattern in global API