Corrected the Dynamic Size Calculation