optimizing
testing write after end