Added code from last lectures