Updated algorithm for RSI