added 4th ed code not arranged yet