--- In this version of the code we have made more use of typedefs in the header file.