refactor
Fixed some structure issues preventing errors in primitive funs
type stuff