use range syntax for writer