updated with lcount command logic