geometric algorithms and ex 6,7 of ML