Added types.h and refactored comments in all the files.