wrote logic