tested and added vector mean functions