prepare some function for 2D MGEVP