Made some logic