Removed random wave function and m_rand code