refactored with random computer player