exercise on elimination algorithm