Updated logic in model.