testing V algorithm