Changed to John Eriksson's chess implementation