commit before changing all functions to use new structures

This commit should serve as a tag, basically, if I fuck things up I can
revert back to this.