Add line number calculation