Merged version of new diskstore.py