changed comments for clearer description of the functions/code