more efficient sequence creation + add generateSequence()
oops, fix bug spotted by @lucaswerkmeister