working function codes and comments are added