using random provided by baum