better tab counting
fixed #53