Text this: Battery Management System Algorithm for Energy Storage Systems Considering Battery Efficiency