Code from my Ghosts! project.