I restructured the code a bit.