Updated to have some tests and whatnot.