changed the three pivot test function