complete codes for models extraction. Start debugging