Tom Shadmi's solution to ex2 in PostPC course