we were obliged to sail well out into the ocean and tack to and fro in order to meet these various conditions , but at length had beaten our way back and anchored a safe distance away , the slave ship barely visible .