removed duplicate mapType function.