Ugh, this is ugly...