Added general sine wave function.