added static name var, simplified offset margin logic