this is a commented version of dominos.cpp