I was high when i coded this, so this commit adds some things i don't
remember.