Some brackets moved so the code is more LISPy.