fixed problem with uinitialized variables, and removed norm2 for compability compilers not supporting fortran 2008