changes, as per glasser's code review