sorted storage implemented, not fully tested