reconciled Will's and my code