write some unit tests for extract. apparently there are still some bugs related to center argument