made v(k) a double precision. k is still a real, that might be a problem but i double it