current working version of part2, incomplete