To extract work from heat, thus producing a perpetual motion machine of the second kind, the most common approach (dating back at least to Maxwell's demon) is "unidirectionality". Only molecules moving fast enough and in the right direction are allowed through the demon's trap door. In a Brownian ratchet, forces tending to turn the ratchet one way are able to do so while forces in the other direction are not. A diode in a heat bath allows through currents in one direction and not the other. These schemes typically fail in two ways: either maintaining the unidirectionality costs energy (requiring Maxwell's demon to perform more thermodynamic work to gauge the speed of the molecules than the amount of energy gained by the difference of temperature caused) or the unidirectionality is an illusion and occasional big violations make up for the frequent small non-violations (the Brownian ratchet will be subject to internal Brownian forces and therefore will sometimes turn the wrong way).