Fixing the data structure for FEM