Paul Belt's solutions to problem #1 and problem #2