Fixing some of the rape my code has been subject to x)