added testType function, some minor updates