added index tests and fixed sma/ema