Safe ty

Fixed almost all of the borrowck error - just need to do something with the mk_T situation, which I think requires transmutes.