Implement part 1 & 2