Explain what happens when boric acid is heated?

Boric add, on heating, loses water in three different stages at different temperatures ultimately giving boron trioxide.