Code improvement according to Guy's comments on Sep. 2, 2014.