algorithms with end