Incorporated review comments given by @michaelrice