wrote logic for computer move