added margin functionality