Changed stupid while loop into a much more sensible for loop....
Removed unecessary extra brackets from if statements. These are not needed in bash
Missed a couple ;)
Removed unused ansi variables
...for consistency's sake
Moved Home Brew instruction echo's inside heredoc
Removed left over else
Corrected small typo