First working version of part2