Hopefully adjusted TimeWriter code