commented EMG analysis code for Margot