Added some variables to keep track of the number of operations.