added the functions & comments