Functions Industry corrected

fixed a bug and commented the code.