Added function documentation and format codes to 80 characters per line