Original table script now working again. Although still need to cleanup c function calling.