proof of Theorem 2 modified for the new Algorithm and other small changes