java changes for part 3