part2 is kinda unoptimized, it should not use expanded input, but I did not feel like rewriting my parsing code :)