exercise 2. Needs lots of cleaning up and a fix for the REGISTER_STRUCT macro.