removed rewind for matrix generation