add logic to share machine algorithm