My changes to Steve's code