ugly but done