modified line counter