add core logic