implement hash invert and fix interface
move vect struct