very ugly but useful