Simplifying logic in zebra class assignment