implement base code