my machine algorithm