various fixes from first tutorial attempt