nearly done w. types, but a lot of cleaning up to do
added new test