some sample code from MNE