Moved vector functions to separate file