Custom variables

Finished (probably). Not quite how I wanted it, but it works.