save rewriting of miranda (not finished yet)