complete logic