Remove redundant array creation
Pre-fill the matrix with -1
Introduce the Offload.Result type