- use a global function check() to keep track of the total number of