removed non write buffering code