Revert 'building model' vectorization

the vectorization takes a long time on MATlab (~8s vs ~1.5s)