changed makeType function