Generate a correctly punctuated version of the following text: I must tell your lordship that the court gardener had had bad luck with his melons this year and when he saw how beautiful ours looked and then tasted them he ordered three of them for the castle
"I must tell your lordship that the court gardener had had bad luck with his melons this year, and when he saw how beautiful ours looked, and then tasted them, he ordered three of them for the castle."