we should also use double for sigma here.