This is some seriously scary code