Average calculation seperate from UI thread.
Average and variance calculation algorithm improved siginificantly.