finish the base function