This is such a terrible piece of code.