added further code to "consolidate the transfers