mostly working now; just a few tweaks left...