new module pek2d to deal with inversions