added tic toc to evaluate computing time
updated function names
updated function names and freruency->frequency