added halflife to exponentially weighted moving functions