Improved comments and changed some parameter definitions/names.