Calculation of ion mixing and energy deposition using a modified version of TRIM