implement runCore