Complex sentence: In 1841 he was elected headmaster of King Edward's school, Bury St Edmunds, but in 1855 he resigned his post and returned to Cambridge, where his time was divided between literary work and private tuition.
Split into simpler sentences: In 1841 he was elected headmaster of King Edward's school, Bury St Edmunds. In 1855 he resigned his post and returned to Cambridge, where his time was divided between literary work and private tuition.