Added more logic.