re-define vw and fix bugs