version 1.1 preparing to skip - with counts vector
Version 1.1 - with skipping and writing final output - only compiles, not tested