Most of the interesting stuff happens here.