Ugly, but working