update with bug fixes from lecturer