replaced string cleansing thing, fixed bug where dicts were not copied correctly