ugly but principle is there