fix width calculations and attribute magic 4 correctly