line numbers bug fix

updated wrap estimation method