Added test code, working out typetable