modify to output sequence