Tom Shadmi's solution to ex1 in PostPC course