added script for reorganising data structure