Added exponential averaging for estimating timeout, haven't tested it yet