Modified UV Decomposition with some boundary condition checks and taking care of division by zero while evaluating entries in U & V