removed unnecessary functions and fixed bug regarding copying dictionaries