rewrote los-gentypes in C