Implemented storing in matom.c