Functional Algorithm with 2-player