reorganized. added V function