refactored margins and stuff