Add following functions using btrees.