- Added calculation of retained credits traversing and summing up credits from bottom to top.