combined two loops into one -refactoring
added test data
bugfixed remove of old column and add new column
removed unused variable