added commentes fixed function names