new script to average and remove mechanical modes