added some more code from the first 3 lectures