complete   logic