added prefetching, spent quite a while debugging it and I am pretty sure that it works correctly, also added some logging to support studying its effectiveness