finished get_type implementation