moved vector stuff to lib. fixed some inconsistencies with registers