Changed the name of the foo function to chunk and moved it to the top