Verify script in bash.
All tests passing, reduced some lines of code.