move infinte operations to the end