updated to use the new chunking that Joe Thibodeau created