implement conmpetition function