complete base function