Comments added to ease code understanding