logic work