Added comments onf file and functions