added source code and updated tutorial for part 3