Counter, commands.cpp and .h

added an argument counter variable and altered functions for commands
files.