Added headers and refactored.