Introduced use of const rather than var for X and O variables.