cleaned code, cleaned output prints, verified behaviour on ems tower