implemented part 2, time to debug.