fixed up grep linecount, havent tested