Fixed bugs, added back wave detection, and renamed find_wave_frontedge