Format code and add comments