added solution
added some comments