Removed some unnecessary lines and started working on the clean_up function