lots of bug fixes and updates (some based on Dean's feedback!)