starting to add functionality with the emergency array, incase they have 999 values in the undo array (primary array)
added emergency array function when undo counter is equal to 999