added code from iteration4 v3.8.3 a iteration5