Ugly but working.