fixed table creation bug
merging work from lab computer