fixed concatonation script to concatonate in increments of 3, 9 and 27