better version using references, zip, and rev