added more explanation comments