Merged Evan's code with Jordan's