fix some bugs left over from yesterday
adding lots more legal stuff