replaced constant vectors with rep vectors of size 1