game algorithm works!