fix data type conflict that lead to a compile error
committing on a train
some refactoring and evolution of the method
implementation of ndgrid started - godclass warning!