added sequential writing