out(Request) ->
        % Q: How do I do the next three lines only when necessary and not every time?
        %    This seems like the sort of thing that Yaws can handle. I guess.  Maybe?
        Dir = "/Users/Alan/Documents/Alan/PhD/courses/CSI 550 - Information Retrieval/Projects/Ziggy/demo/",
        shell_default:cd(Dir),
        shell_default:c(ziggy3),
        Results = case queryvar(Request, "startUrl") of
                      {ok, StartUrlStr} -> case queryvar(Request, "stopAfter") of
                                               {ok, StopAfterStr} -> callZiggy(StartUrlStr, StopAfterStr);
                                               undefined          -> "Error: Missing stopAfter arg."
                                           end;
                      undefined      -> "Error: Missing startUrl arg."
                  end,
        Response = erlang:system_info(system_version) ++ Results,
        {html, Response}.

    callZiggy(StartUrlStr, StopAfterStr) ->
        case string:to_integer(StopAfterStr) of
            {error, _}        -> "Error: The startAfter arg is not an integer.";
            {StopAfterInt, _} -> io_lib:format("Z I G G Y  ][~nBeginning crawl at ~p.~nStopping after ~p documents.~n", [StartUrlStr, StopAfterInt]),
                                 if StartUrlStr /= "?" ->
                                     {Message, CrawlHistory} = ziggy3:start(StartUrlStr, StopAfterInt),
                                     io_lib:format("Result: ~p~nCrawl History:~n~p~n", [Message,CrawlHistory]);
                                 true ->
                                     io_lib:format("-", [])
                                 end
        end.