make the require in main optional in case we are adding this library outside of node
added sorted set structure