added random() member to State