removing commented out code
fixed small problem with line counting
improving position handling