a bunch of skinning, and some bugfixing