Suppose we have an insulated cylindrical container with a piston inserted from one end. Suppose the volume confined by the piston is full of a hot gas. Now let the gas drive the piston so that the volume is increased. Did the entropy of the system decrease because some of the energy of the disordered random-directional movement of the gas molecules (disordered movement) was converted to the linear (one-directional) kinetic energy of the piston (more ordered movement)? How does this not violate the second law of thermodynamics?