fixed NaN bug, added moving averages for smoothing theta