comlement two arlgorithems