added wave th function