cosmetic changes. Decided to keep the loops (for parallelization)
bug fix. Still something is strange. working on it