commented the whole code