updated exercise D