finish the logical part