## 2 Methodology
### Tools and Data Input for Mapping Energy Flows  
The Sankey diagram has become an important graphical tool for mapping energy flows. In an energy Sankey diagram, various types of energy flows are illustrated in different colors with the width indicating energy quantities. [PERSON] has provided a comprehensive review of Sankey diagrams in energy and material flow management [18]. Figure 1: The framework of the system approach. The method used to map energy flows into a Sankey diagram in this study was mainly based on previous studies on global energy flows [19] and China's energy flows [20,21], but adjusted to take into account the specifics of Malaysia's energy system and also the data availability. Using this method, the whole energy system of Malaysia was divided into three stages: (1) Primary supply; (2) Secondary supply; and (3) End-use. In addition, Non-Energy Use was excluded from the energy flowing to End-use in the Primary supply and Secondary supply. The energy flows and energy types involved in each stage are shown in Table 1, and the energy types involved are listed in Table 2.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Stage** & **Energy flows** & **Description [22]** \\ \hline \multirow{6}{*}{Primary Supply} & \multirow{2}{*}{Primary Production} & Refers to the amount of primary energy resources extracted. Data for natural gas excludes the amount of re-injected and flared gas. Gross production of hydropower is calculated by primary energy equivalent quantity. \\ \cline{2-3}  & Gas Flaring and & Refers to the amount of gas flared, re-injected into the gas fields and use for production purposes. \\ \cline{2-3}  & \multirow{2}{*}{Imports and Exports} & Refers to the amount of primary and secondary energy obtained from or supplied to other countries. \\ \cline{2-3}  & \multirow{2}{*}{Bunkers} & Refers to the amount of fuels delivered to ocean-going ships of all flags engaged in international traffic. \\ \cline{2-3}  & \multirow{2}{*}{Stock Changes} & Refers to the difference between the amount of fuels in stocks at the beginning and end of the year and should ideally cover producers, importers, and industrial consumers. At this stage, however, only oil companies stocks are taken into account. \\ \hline \multirow{3}{*}{Secondary Supply} & Gas Plants & Refers to the input of natural gas into LNG, MDS and GPP-LPG plants and their respective outputs. \\ \cline{2-3}  & Refineries & Refers to the input of energy resources into refineries and their respective outputs. \\ \cline{2-3}  & Power Plants & Refers to the input of energy resources into power plants and electricity outputs. \\ \hline \multirow{6}{*}{End-use} & Residential & Refers to energy used within households. \\ \cline{2-3}  & Commercial & Refers to energy used within commercial departments, including public buildings. \\ \cline{2-3}  & \multirow{2}{*}{Industrial} & Industrial is a very broad-based sector, ranging from manufacturing to mining and construction. Diesel sales through distributors are assumed to be industrial consumers. \\ \cline{2-3}  & \multirow{2}{*}{Transportation} & Refers to all sales of motor gasoline and diesel from gas stations and sales of aviation fuel. It also includes diesel and motor gasoline sold directly to the government and military. \\ \cline{2-3}  & Agriculture & Covers agricultural, forestry and fishing. \\ \hline \multirow{6}{*}{Non-energy Use} & \multirow{2}{*}{Refers to products resulting from the transform processes for non-energy purpose (bitumen/lubricants, asphalt/greases) and use of energy products (such as natural gas) as industrial feed stocks.} \\ \cline{2-3}  & & Refers to the amount of fuels delivered to ocean-going ships of all flags engaged in international traffic. \\ \cline{1-1} \cline{2-3}  & & Refers to the amount of fuels in stocks at the beginning and end of the year and should ideally cover producers, importers, and industrial consumers. At this stage, however, only oil companies stocks are taken into account.