Plug-in electric vehicles (PEVs) are gaining popularity as a solution to reduce greenhouse gas production. On the other hand, uncoordinated charging of PEVs is a reason for grid stress and increasing congestion, total power consumption (TPC) and distribution lines and transformers losses. Moreover, single-phase connection of electric vehicles in residential buildings causes line current imbalance and it has more negative effects on TPC and power losses. Thus, they are characterised as unbalanced loads with random locations, plug-in times, charging rates, and durations. Hence, a charging coordination algorithm is proposed to utilise the integration of PEVs in both operational modes (grid-to-vehicle, vehicle-to-grid) to guarantee power loss reduction, voltage profile maintaining and load current balancing. The introduced algorithm can perform an optimal calculation to determine proper phase for PEVs in distribution feeders and decline the unbalancing by deploying a new device called phase switcher which is in series with chargers in residential buildings. The phase switcher is connected to the smart load management centre which uses the proposed algorithm to determine the proper phase for connection or disconnection of PEVs and finding the appropriate numbers of PEVs. To show the effectiveness of the proposed algorithm, simulation results are provided.