fix header and code formatting