updated printing cascade code