shifted preallocation

accidentally had preallocation inside the loop