It now works again, but with a better object-oriented design.