added functionality to delete all {} pairs except the last one