Code formatting and add comments