using SplObjectStorage + added tests