changed wave_math to math functions