Fixed piping issues and cleaned up code

I didn't realize I don't have to put parenthesis around calls to
function definitions.