And We gave understanding of this that is the judgement to Solomon. It is said that both of their decisions were the result of independent judgement exercised by both and that David consulted Solomon; but it is also said that their decisions were by way of inspiration from God — the second decision abrogated the first. And to each of the twain We gave judgement prophethood and knowledge in matters of religion. And We disposed the mountains to glorify God with David and the birds also were disposed to glorify God with him for he David had commanded such glorification on their part so that whenever there was a lapse on his part he would be reminded to apply himself to the task of glorifying God promptly. And We were certainly doers of this disposing of them to glorify God along with him even if it should amaze you that they should be able to respond to the lord David.