How do i make random motion only along y-axis?

I tried the random motion tutorial with my design, but I would like my design elements to move only up and down along the y-axis. How can I modify the script to do so?

Thanks,
Jim