Seamless Operation of a Microgrid Using BESS