random (~) is not working properly, see TODO