Cleaned up code and added header to each page