made random phases optional