updated comments for logic