A buggy simple storage manager, please do NOT copy without reading