added vec, switched to register code