THIS STUFF IS REALLY COMPLICATED.