updated formatting code