Phew, that's a lot of code.