vector-izing some operations