fix a few bugs; get first working edition