Added 'gr' function to grep recursively.
Moved 'then' to the end of 'if' lines.