preliminary coin placement algorithm, switching machines