Initial merge of Ethan's code