Works. Ugly but works