Library for maintaining sorted Arrays borrowed from Python