updated C with structs and constructors