Vector-manipulation utility functions