added foldLeft to compute bytes to skip