Fixing dupe lines and formatting code