Completed Algorithm and Calculations for lower bound