Issue-48 done, for changed to foreach