working on VAD function
ruby implementation unnecesary for cpp only