Changes from glasser's code review