Ethan's code tweaks