Realized that the maps and options are created each time the command is called and swapped the Hashtables for HashMaps
Improved count matches function