update and fix sequence code; no longer broken