first piece of logic