refined comments for clearer understanding of implementation