Added some logic.