Add in a rolling averages. Add in socket error handling.