added free function for chunks