improved class analyzer (using 5 passes now instead of 3)