Changing datastructure from simple arrays to Tableau class
added some documentaiton