updated type system, fixed a couple typos