How is energy transferred through waves?