improved unbuffer