refactored eosAlgo