added sourcecode from lecturer