Rewritten for clarity with 269e43eb33ab05475509589e7c42191eab87dd5d