formatted code and modified headers