some of part 3
further part 3 progress