Reorganized Zach's code
what