add parse_type and a bunch of stuff, forgot.