Books III IV and V treat spherical trigonometry which of course is of major importance in astronomy

What is the correctly punctuated version of this sentence?
Books III, IV and V treat spherical trigonometry which, of course, is of major importance in astronomy.