implement base logic