Using generate method.