fixed re calculation with boundary conditions
added rg