updating and formatting code