Line numbers now calculated correctly