Changed implementation of Exponential Moving Average