fix porting elan's code to test data. now need to fix mine.