changed double precision to real(kind=8)