I didn't merge these parts because I have some other WIP code I was working on. Might as well put this in now.
This is definitely not perfect, but it's a simple stub which we can expand on.