I keep getting an error message when running my code at the end. I think it has something to do with line 26, but I'm not sure how to correct it. the error is
sh: PAUSE: command not found
This instructs your programme to ask the shell it is running inside to execute the command PAUSE, just as if you had typed PAUSE into a command line yourself. Your shell has no such command, and hence returns as error message. As I recall, this command commonly exists in various Windows shells, but is not present in bash, csh, tcsh, fish and a number of other shells that are commonly used in *nix operating systems.
The solution is to step away from this hideous OS-dependent hack and do something actually within your programme if you want to pause the programme.