implement base function