building ema function inside branch instead of master