Implementation of FEM class