A smart charging algorithm for integration of EVs in providing primary reserve as manageable demand-side resources