Change unsigned int to size_t
Add function to count total commands