implemented the non chunked version correctly