Generation of unit cells working for both p2 and p2gg