Working version - makes correct sequences