first worked example
small bug fixes