add RMQ algorithms