Very little time is spent in this function; everything that was in subfunctions before, still is.