Added syntactic sugar to function definitions.

In bash, the "function" reserved word is superfluous, but used here
to give users unfamiliar with bash (like me) more context clues to
help them understand the script.