improved marker-logic