Its ugly but it works