It turned out that Hamilton had made an poor choice as he lost interest in astronomy and spend all time on mathematics

What is the correctly punctuated version of this sentence?
It turned out that Hamilton had made an poor choice as he lost interest in astronomy and spend all time on mathematics.