Started adding some logic