Modified and corrected the code for buttord and frezq