more import errors and making p-value test more robust to numerical errors