fixed issue with pointers and implemented generation method reading from .fmt