added RMQ - naive