add collapse reads code