intermediate checkin with lots of changes. Still qvec is unstable