started adding code for calculating the ECF