using list::remove_if to implement CountLasing rather than manually counting