Made code clearer and changed comment