added support for lists and fixed a bunch of misc stuff